
#------ MAKE CHANGES TO BASE_DIR : Please put the path to base directory of your pristine gcc-4.7.2 build -----------#
BASE_DIR = /home/vinit/cs715/gcc

INSTALL = $(BASE_DIR)/install
CC = $(INSTALL)/bin/g++
NEW_PATH = $(BASE_DIR)/gcc-4.7.2/gcc

#----- MAKE CHANGES TO OBJS : Add the name of your test file with extension .o (say test as test.o) --------#
#------------------------------- Multiple dependent files maybe also be added ------------------------------#
OBJS = test9.o

GCCPLUGINS_DIR:= $(shell $(CC) -print-file-name=plugin)
INCLUDE= -I$(GCCPLUGINS_DIR)/include -I$(NEW_PATH)

FLAGS= -fPIC -O0 -flto -flto-partition=none


%.o : %.c
	$(CC) $(FLAGS) $(INCLUDE) -c $< 

plugin.so: pointsto-callstrings.o 
	$(CC) $(INCLUDE) $(FLAGS) -shared $^ -o $@

test:  $(OBJS) plugin.so
	$(CC) -o result -flto -flto-partition=none -fplugin=./plugin.so $(OBJS) -fdump-ipa-all

clean:
	\rm -f plugin.so *~ *.o a.out result*


